/*
*  LLConfig.h
*  
*
*  Created by Alexander Trutchenko on 11/02/12.
*  Copyright 2012 Free Team. All rights reserved.
*
*/

#ifndef __LL_Config_h__
#define __LL_Config_h__


namespace lidlib {

//////////////////////////////////////////////////////////////////////////
// Library config

#define LL_LOG_LEVEL 3

//////////////////////////////////////////////////////////////////////////
// pre configure
//////////////////////////////////////////////////////////////////////////

// define supported target platform macro which LL uses.
#define LL_PLATFORM_UNKNOWN            0
#define LL_PLATFORM_IOS                1
#define LL_PLATFORM_ANDROID            2
#define LL_PLATFORM_WOPHONE            3
#define LL_PLATFORM_WIN32              4
#define LL_PLATFORM_AIRPLAY            5
#define LL_PLATFORM_BADA               6
#define LL_PLATFORM_LINUX              7


// Determine tartet platform by compile environment macro.
#define LL_TARGET_PLATFORM             LL_PLATFORM_UNKNOWN

// iphone
#if ! LL_TARGET_PLATFORM && (defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR))
    #undef  LL_TARGET_PLATFORM
    #define LL_TARGET_PLATFORM         LL_PLATFORM_IOS
    #define LL_SUPPORT_MULTITHREAD 0
    #define LL_SUPPORT_UNICODE 0
    #define LL_SUPPORT_PVRTC
#endif

// android
#if ! LL_TARGET_PLATFORM && defined(ANDROID)
    #undef  LL_TARGET_PLATFORM
    #define LL_TARGET_PLATFORM         LL_PLATFORM_ANDROID
#endif

// wophone
#if ! LL_TARGET_PLATFORM && defined(_TRANZDA_VM_)
    #undef  LL_TARGET_PLATFORM
    #define LL_TARGET_PLATFORM         LL_PLATFORM_WOPHONE
#endif

// win32
#if ! LL_TARGET_PLATFORM && (defined(WIN32) && defined(_WINDOWS))
    #undef  LL_TARGET_PLATFORM
    #define LL_TARGET_PLATFORM         LL_PLATFORM_WIN32

    #define LL_SUPPORT_MULTITHREAD     1
    #if defined(UNICODE)
        #define LL_SUPPORT_UNICODE     1
    #else
        #define LL_SUPPORT_UNICODE     0
    #endif
#endif

// linux
#if ! LL_TARGET_PLATFORM && defined(LINUX)
    #undef  LL_TARGET_PLATFORM
    #define LL_TARGET_PLATFORM         LL_PLATFORM_LINUX
#endif

// airplay
#if ! LL_TARGET_PLATFORM && defined(AIRPLAY)
#undef  LL_TARGET_PLATFORM
#define LL_TARGET_PLATFORM         LL_PLATFORM_AIRPLAY
#endif
// bada
#if ! LL_TARGET_PLATFORM && defined(SHP)
#undef  LL_TARGET_PLATFORM
#define LL_TARGET_PLATFORM         LL_PLATFORM_BADA
#endif
//////////////////////////////////////////////////////////////////////////
// user configure
//////////////////////////////////////////////////////////////////////////

// Check user assigned target platform.
#if defined(LL_UNDER_IOS)
    #undef  LL_TARGET_PLATFORM
    #define LL_TARGET_PLATFORM         LL_PLATFORM_IOS
#endif

#if defined(LL_UNDER_ANDROID)
    #undef  LL_TARGET_PLATFORM
    #define LL_TARGET_PLATFORM         LL_PLATFORM_ANDROID
#endif

#if defined(LL_UNDER_WOPHONE)
    #undef  LL_TARGET_PLATFORM
    #define LL_TARGET_PLATFORM         LL_PLATFORM_WOPHONE
#endif

#if defined(LL_UNDER_WIN32)
    #undef  LL_TARGET_PLATFORM
    #define LL_TARGET_PLATFORM         LL_PLATFORM_WIN32
#endif

#if defined(LL_UNDER_AIRPLAY)
#undef  LL_TARGET_PLATFORM
#define LL_TARGET_PLATFORM			   LL_PLATFORM_AIRPLAY
#endif
#if defined(LL_UNDER_LINUX)
#undef  LL_TARGET_PLATFORM
#define LL_TARGET_PLATFORM			   LL_PLATFORM_LINUX
#endif

#if defined(LL_UNDER_BADA)
#undef  LL_TARGET_PLATFORM
#define LL_TARGET_PLATFORM			   LL_PLATFORM_BADA
#endif

// Check user assigned supportive of multi-thread
#if defined(LL_ENABLE_MULTITHREAD)
    #undef  LL_SUPPORT_MULTITHREAD
    #define LL_SUPPORT_MULTITHREAD     1
#elif defined(LL_DISABLE_MULTITHREAD)
    #undef  LL_SUPPORT_MULTITHREAD
    #define LL_SUPPORT_MULTITHREAD     0
#endif

// Check user assigned supportive of unicode
#if defined(LL_ENABLE_UNICODE)
#undef  LL_SUPPORT_UNICODE
#define LL_SUPPORT_UNICODE             1
#elif defined(LL_DISABLE_UNICODE)
#undef  LL_SUPPORT_UNICODE
#define LL_SUPPORT_UNICODE             0
#endif

//////////////////////////////////////////////////////////////////////////
// post configure
//////////////////////////////////////////////////////////////////////////

// check user set platform
#if ! LL_TARGET_PLATFORM
    #error  "Can not recognize the target platform, compling under a unsupported platform?"
#endif 

// Check the supportive of platform
#if (LL_TARGET_PLATFORM == LL_PLATFORM_WIN32)
	#pragma warning (disable:4127)  
#endif  // LL_PLATFORM_WIN32

} // namespace lidlib

#endif //__LL_Config_h__
